package com.education.controller.backend;

import com.education.pojo.News;
import com.education.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by Administrator on 2018/5/3.
 */
@Controller
public class NewsController{
    @Autowired
    private NewsService newsService;
    @CrossOrigin
    @ResponseBody
    @RequestMapping("/news")
    public List<News>  show(@RequestBody News news){
        Integer nzt=news.getnZt();
        List<News> nzts=newsService.selectByPrimaryKey(nzt);
        return  nzts;
    }
}



